<template>
  <el-scrollbar height="calc(100vh - 60px)">
    <el-menu v-if="show" :collapse="collapse" :default-active="activeIndex" class="menu">
      <menuItem :options="options">
      </menuItem>
    </el-menu>
  </el-scrollbar>
</template>
<script setup lang="ts">
import { ref, watch, nextTick } from "vue";
import menuItem from "../privately/menu_item.vue";
import { ElScrollbar, ElMenu } from "element-plus";

interface prop {
  options: interfaceMenu[];
  activeIndex: string;
  collapse?: boolean;
}
const show = ref(true);
const { options = [], collapse = false } = defineProps<prop>();
watch(
  () => options,
  async () => {
    show.value = false;
    await nextTick();
    show.value = true;
  },
);
</script>
